package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.ExpertNewVO;
import com.digitalchina.lxnsy.toolkit.FrescoUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2017/2/20 10:58
 * 修改备注：
 * ================================================
 */
public class RecommendExpertHolder extends BaseViewHolder<ExpertNewVO> {

    private SimpleDraweeView ivImage;
    private TextView tvExpertName;

    public RecommendExpertHolder(ViewGroup parent) {
        super(parent, R.layout.item_recommend_experts);
        ivImage = $(R.id.item_recommend_sdv_head);
        tvExpertName = $(R.id.item_recommend_tv_name);
    }

    @Override
    public void setData(ExpertNewVO data) {
        super.setData(data);
        FrescoUtil.showImageSmall(data.getPhoto() != null ? data.getPhoto() : "", ivImage);
        tvExpertName.setText(data.getExpertName() != null ? data.getExpertName() : "");
    }
}
